* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #1a73e8;
    margin-bottom: 10px;
}

.video-chat-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.videos {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-container {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    padding-top: 56.25%; /* 16:9 比例 */
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

button {
    padding: 12px 24px;
    margin: 0 10px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#startButton {
    background: #1a73e8;
    color: white;
}

#startButton:hover {
    background: #1557b0;
}

#callButton {
    background: #34a853;
    color: white;
}

#callButton:hover {
    background: #2d8745;
}

#hangupButton {
    background: #ea4335;
    color: white;
}

#hangupButton:hover {
    background: #d33426;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#status {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

/* 模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    z-index: 1001;
}

.modal h2 {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.modal-buttons button {
    margin: 0;
    width: 100%;
}

.modal-content {
    text-align: center;
    color: #5f6368;
    font-size: 16px;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-chat-container {
        flex-direction: column;
    }
    
    .videos {
        flex-direction: row;
    }
    
    .video-container {
        padding-top: 75%; /* 4:3 比例 */
    }
}

@media (max-width: 480px) {
    .videos {
        flex-direction: column;
    }
    
    .video-container {
        padding-top: 56.25%; /* 16:9 比例 */
    }
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-messages {
    height: 300px;
    padding: 10px;
    overflow-y: auto;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    gap: 10px;
    background-color: #fff;
    border-top: 1px solid #eee;
}

#messageInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    border-color: #007bff;
}

#sendButton {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#sendButton:hover {
    background: #0056b3;
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 70%;
    position: relative;
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    overflow: hidden;
}

.message .content {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
    line-height: 1.5;
    font-size: 14px;
}

/* 滚动条样式 */
.message .content::-webkit-scrollbar {
    width: 6px;
}

.message .content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.message .content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.message.sent .content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
}

/* 调整字体大小 */
.message .content {
    font-size: 14px;
}

.message.sent .content {
    color: white;
}

/* 添加展开/收起按钮 */
.message .expand-button {
    display: none;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    align-self: flex-start;
}

.message.sent .expand-button {
    background: rgba(255, 255, 255, 0.2);
}

.message.expanded .content {
    max-height: none;
}

.message.expanded .expand-button {
    display: none;
}

.message:not(.expanded) .content {
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.message:not(.expanded) .expand-button {
    display: block;
}

.message.sent {
    background: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.received {
    background: #f1f0f0;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.message .timestamp {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    text-align: right;
}

.message.sent .timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.message.sent .avatar {
    display: none;
}

.message.received {
    display: flex;
    align-items: flex-start;
} 